package com.xinxin.base.exception;

import com.xinxin.base.entity.ResultCode;
import lombok.Getter;

/**
 * 业务异常
 *
 * @author ys
 * @date 2020/5/15
 */
@Getter
public class BusinessException extends RuntimeException {

    private static final long serialVersionUID = 5774582453000291387L;

    private Integer code;

    public BusinessException(ResultCode resultCode) {
        this(resultCode.getCode(), resultCode.getMsg());
    }

    public BusinessException(Integer code, String message) {
        super(message);
        this.code = code;
    }
}
